//
//  YXViewController.m
//  YXPopList
//
//  Created by Arthur on 05/15/2020.
//  Copyright (c) 2020 Arthur. All rights reserved.
//

#import "YXViewController.h"
#import "YXPopupListView.h"

@interface YXViewController ()

@property (nonatomic,strong) UIView *redView;


@property (weak, nonatomic) IBOutlet UIView *backview;


@end

@implementation YXViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    
    
}

- (IBAction)buttonClick:(UIButton *)sender {
    
    CGPoint point = [sender.superview convertPoint:CGPointMake(CGRectGetMinX(sender.frame), CGRectGetMaxY(sender.frame)) toView:self.view.window];
    CGRect rect = CGRectMake(point.x, point.y, sender.frame.size.width, 300);
    
    [YXPopupListView showWithArray:@[] withTableViewRect:rect andCallBack:^(id  _Nonnull model) {
        NSLog(@"model ****** %@",model);
    }];
}



- (UIView *)redView {
    if (!_redView) {
        _redView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
        _redView.backgroundColor = UIColor.blueColor;
        [self.view.window addSubview:_redView];
    }
    return _redView;
}


- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
